create table jms_dm.dm_tms_shipment_error_scan_detail_dt(
    shipment_no       varchar(255) comment '任务单号'
    ,waybill_no       varchar(255) comment '运单号'
    ,shipno_planned_departure_date date comment '任务单规划发车日期'
    ,scan_site_code   varchar(255) comment '扫描站点代码'
    ,scan_site_name   varchar(255) comment '扫描站点名称'
    ,next_site_code   varchar(255) comment '下一站代码'
    ,next_site_name   varchar(255) comment '下一站名称'
    ,scan_type        varchar(255) comment '扫描类型'
    ,scan_user_code   varchar(255) comment '扫描员工代码'
    ,scan_user_name   varchar(255) comment '扫描员工名称'
    ,scan_time        datetime    comment '扫描时间'
)
 ENGINE=OLAP
DUPLICATE KEY(`shipment_no`,`waybill_no`)
COMMENT "干线装载率-错扫明细"
PARTITION BY RANGE(`shipno_planned_departure_date`)(
    START ("2024-01-15") END ("2024-02-15") EVERY (INTERVAL 1 day)
)
DISTRIBUTED BY HASH(`shipment_no`) BUCKETS 1
PROPERTIES (
    "replication_num" = "3",
    "dynamic_partition.enable" = "true",
    "dynamic_partition.time_unit" = "DAY",
    "dynamic_partition.time_zone" = "Asia/Shanghai",
    "dynamic_partition.start" = "-180",
    "dynamic_partition.end" = "3",
    "dynamic_partition.prefix" = "p",
    "dynamic_partition.buckets" = "1",
    "in_memory" = "false",
    "storage_format" = "V2",
    "enable_persistent_index" = "false"
);
